import torch
import torchvision
import torch.nn as nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter

class Module(nn.Module):
    def __init__(self):
        super().__init__()
        self.relu = nn.ReLU()
        self.sigmoid = nn.Sigmoid()
        self.linear = nn.Linear(in_features=196608,out_features=10)
    def forward(self,input):
        return self.linear(input)


writer = SummaryWriter("log4")
data_test = torchvision.datasets.CIFAR10("./datavision", train=False, transform=torchvision.transforms.ToTensor())
datas = DataLoader(data_test,batch_size=64,shuffle=True,drop_last=True)
MyModule = Module()
step = 0
for data in datas:
    imgs,targets = data
    print(imgs.shape)
    imgs_flatted = torch.flatten(imgs)
    print(imgs_flatted.shape)
    output = MyModule(imgs_flatted)
    print(output.shape)
    # writer.add_images("origin",imgs,step)
    # writer.add_images("relu",MyModule(imgs),step)
    step += 1
writer.close()